import http from "@/http";
// 查询订单
export const getOrderListApi=(params:any):RES<any>=>http.get('/order/list',{params})
// 查看订单
export const getOrderRoleIdApi = (
    orderId: number
  ): RES<OrderModel> => http.get(`/order/${orderId}`);
// 备注订单
export const getUpdateNoteApi = (id: number, note: string, status: number): RES<number> => http.post(`/order/update/note?id=${id}&note=${note}&status=${status}`)
//批量删除订单
export const getOrderDeleteTwoApi = (id: number[]): RES<number> => http.post(`/order/delete?ids=${id.join(',')}`)

// 批量关闭订单
export const getUpdateCloseApi = (id: number[], note: string): RES<number> => http.post(`/order/update/close?note=${note}&ids=${id.join(',')}`)
// 删除订单
export const DeleteOrderApi = (ids: number): RES<DeleteModel> =>
  http.post(`/order/delete?ids=${ids}`);
// 设置订单
export const getOrderSettingApi=(id:number):RES<OrderSettingModel>=>http.get(`/orderSetting/${id}`)
// 修改指定订单设置
export const updateOrderSettingApi = (params: OrderSettingModel): RES<number> =>
  http.post(`orderSetting/update/${params.id}`, params);

// 分页查询全部退货原因
export const getReturnReasonListApi=(params:any):RES<any>=>http.get('returnReason/list',{params})
// 分页查询退货申请
export const getReturnApplyListApi=(params:any):RES<any>=>http.get('returnApply/list',{params})
// 退货申请查看详情
export const getReturnApplyRoleIdApi = (
  ApplyId: number
): RES<ReturnApplyModel> => http.get(`/returnApply/${ApplyId}`);
// 添加退货原因
export const returnReasonCreateApi = (params: returnReasonCreateModel): RES<returnReasonCreateModel> =>
  http.post("/returnReason/create", params);
  // 获取编辑退货原因id
export const getReturnReasonById = (id: number): RES<returnReasonCreateModel> =>
  http.get(`/returnReason/${id}`);
   // 编辑退货原因
export const updateReturnReason = (params: returnReasonCreateModel): RES<number> =>
  http.post(`/returnReason/update/${params.id}`, params);

// 删除退货原因
export const DeleteReturnReasonApi = (ids: number): RES<DeleteModel> =>
  http.post(`/returnReason/delete?ids=${ids}`);
  // 批量删除退货申请
export const getReturnApplyDeleteApi = (id: number[]): RES<number> => http.post(`/returnApply/delete?ids=${id.join(',')}`)
// 修改退货原因状态
export const switchReturnReasonStatusApi = (id: number, status: number): RES<any> =>
  http.post(`returnReason/update/status?status=${status}&ids=${id}`);
  // 批量删除退货原因
export const getReturnBatchDeleteApi = (id: number[]): RES<number> => http.post(`/returnReason/delete?ids=${id.join(',')}`)